from dataclasses import dataclass
from decimal import Decimal
from typing import List

from pydantic import BaseModel


@dataclass
class EnergyManagementInput:
    battery_energy: Decimal
    load: Decimal
    solar_output: Decimal
    wind_output: Decimal
    price_grid: Decimal
    price_wind: Decimal
    price_solar: Decimal
    battery_capacity: Decimal
    battery_charge_efficiency: Decimal = Decimal('0.9')
    battery_discharge_efficiency: Decimal = Decimal('0.9')
    battery_max_charge_power: Decimal = Decimal('5.0')
    battery_max_discharge_power: Decimal = Decimal('5.0')

class EnergyInputSeries(BaseModel):
    solar_price_values: List[float]     # 太阳能电价（price_type = 0）
    wind_price_values: List[float]      # 风能电价（price_type = 1）
    normal_price_values: List[float]    # 国网电价（price_type = 2）

    solar_values: List[float]           # 太阳能输出（category_id = 4）
    wind_values: List[float]            # 风能输出（category_id = 3）
    load_values: List[float]            # 负荷需求（category_id = 5）